<?php
namespace api\modules\v1\controllers;
use common\service\RechargeService;
use common\models\EthTradeLog;

/*
	充值
*/

class RechargeController extends CoreController
{

	/*
		* 充值配置信息
	*/
	public function actionConf()
	{
		$params = [
			'member_id' => $this->_memberId,
			'address'	=> $this->_member['address'],
			'private_key' => $this->_member['private_key'],
            'b_type'      =>1,
		];

		$res = RechargeService::conf($params);
		if(!$res['state']) $this->error($res['msg']);
		$this->out('充值配置信息', $res['data']);
	}


	/*
		充值列表
	*/

	public function actionList()
	{
		$whereArr = array();
		$whereArr['where'] = ['member_id' => $this->_memberId];
		$params = array(
			'field' => ['*'],
			'page'	=> $this->request('page',1),
			'limit' => $this->request('page_size',15),
			'order' => 'id DESC'
		);		
		$data = EthTradeLog::dataList($whereArr, $params,['list']);
		$this->out('充值列表', $data);
	}

}